Hello all: I am working on a common project (with my student) off Dropbox on a Windows PC (with 3 different paths for the 3 PCs I have). My student (Emily) uses an IMac and has only one desktop. Both have different paths to our root project ./gv_includes folder in Dropbox.
The do file below is designed to generate K-M plots and save them in a different directory in Dropbox.
I would like to stay in the .\gv_includes folder as the working directory in stata for both of us while stepping out of this directory to save any images in a different Dropbox directory. Would like some pointers for how I could come back to the gv_includes for both of us after stepping out of the working directory to save images elsewhere. Is preserve/restore the best option that would work for both of us?
See below for sample code I have at the moment.
Code to set each of our working directories to gv_includes:
Further down in the do file generating figures:
The do file below is designed to generate K-M plots and save them in a different directory in Dropbox.
I would like to stay in the .\gv_includes folder as the working directory in stata for both of us while stepping out of this directory to save any images in a different Dropbox directory. Would like some pointers for how I could come back to the gv_includes for both of us after stepping out of the working directory to save images elsewhere. Is preserve/restore the best option that would work for both of us?
See below for sample code I have at the moment.
Code to set each of our working directories to gv_includes:
Code:
*------------------------------------------------------------------------------- **********----FIGURES AND TABLES FOR USCAP ABSTRACT---************************** *------------------------------------------------------------------------------- **# Set working directory---Directory agnostic now *-------------------------------------------------- if regexm(c(os),"Mac") == 1 { local mypath = "/Users/emilys/Dropbox/Girish Files/gv_includes" } *------------------------------------------------------------------------------- cap cd "C:\Users\Vijayalakshmi\Dropbox\Girish Files\gv_includes" cap cd "C:\Users\NewPC\Dropbox\Girish Files\gv_includes" cap cd "D:\gvenkataraman\Documents\Dropbox\Girish Files\gv_includes" qui do "p53select_phantm.doh.do" // Selects the subset for study count qui include unicoder
Further down in the do file generating figures:
Code:
**#Fig2A *------------------ local b germline local title "Germline alt. in subset with {it:TP53{sup:SH}}" local subset "if inlist(icc2,0)" if regexm(c(os), "Mac") == 1 { include "/Users/emilys/Dropbox/gv_includes/gvkm2_nonpgm_risktablev2.1_km.do" } else if regexm(c(os), "Windows") == 1 { include ".\gvkm2_nonpgm_risktablev2.1_km.do" } if regexm(c(os), "Mac") == 1 { graph export "/Users/emilys/Dropbox/Project Amandeep TP53/phantm/Fig_uscap24_Fig2A.png", width (2400) height(1600) replace as(png) } else if regexm(c(os), "Windows") == 1 { gv p53 // Program that only I use for changing to top level directory->phantm folder to save images graph export ".\phantm\Fig_uscap24.png_Fig2A.png", width (2400) height(1600) replace as(png) }
Comment